﻿@model IEnumerable<EventSys.BussinesEntities.Auspiciador>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link rel="stylesheet" href="/resources/demos/style.css" />

<h2>LISTA DE AUSPICIADORES</h2>

@*<p>
    @Html.ActionLink("Nuevo", "Create")
</p>




@using (Html.BeginForm())
{
    <fieldset>
        <legend></legend><b>R. Social o DNI:</b>
        <input type="search" name="criterio" value="" placeholder="Ingrese R. Social o Dni" />
        <input type="submit" name="buscar" value="Buscar" class="k-button" />*@

@*        <b>Tipo de Auspiciador</b>
        <select class="tipoauspiciador">
            <option value="01">Todos</option>
            <option value="02">Jurídicos</option>
            <option value="03">Naturales</option>
        </select>*@

@* <h3> <b>Seleccionar Tipo de Auspiciador:
            @Html.DropDownListFor(model => model.TipoAuspiciador, new SelectList(new List<Object>{ 
                       new { value = 0 , text = "Jurídico"  },
                       new { value = 1 , text = "Natural" },
                    }, "text", "text",0), new { id="cbTipoAuspiciador", style="font-size:16px; color:red; font-weight:800"})</b>  </h3>
        </div>*@

@*</fieldset>
}*@




<div class="CSSTableGenerator">


    @using (Html.BeginForm())
    {
        <fieldset>
            <legend></legend><b>Nombres o DNI:</b>
            <input type="search" name="criterio" value="" placeholder="Ingrese Nombres o DNI" />
            <select id="tipoAusp">
                <option value="Jurídico">Jurídico</option>
                <option value="Natural">Natural</option>
                <option value="Todos">Todos</option>
            </select>
            <input type="submit" name="buscar" value="Buscar" class="k-button" />

        </fieldset>
    }

    <table>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.RazonSocial)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Marca)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Direccion)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Telefono)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.PageWeb)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Representante)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.RucDni)
            </th>

            <th></th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.RazonSocial)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Marca)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Direccion)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Telefono)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PageWeb)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Representante)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.RucDni)
                </td>
                <td>
                    @Html.ActionLink("Editar", "Edit", new { id = item.idAuspiciador }) |
                    @Html.ActionLink("Eliminar", "Delete", new { id = item.idAuspiciador },
                                        new { onClick = "return confirm('Desea Eliminar Auspiciasdor:" + @item.RazonSocial + "?');" })|
                    @Ajax.ActionLink("Detalles", "Index", new AjaxOptions()
               {
                   Url = Url.Action("Details", new { id = item.idAuspiciador }),
                   UpdateTargetId = "upDetails",
                   OnSuccess = "OnSuccessDetails"
               })
                </td>
            </tr>
        }

    </table>

    @*<div id="tabs">
        <ul>
            <li><a href="#tabJuridico">Auspiciador Jurídico</a></li>
            <li><a href="#tabNatural">Auspiciador Natural</a></li>
        </ul>
        <div id="tabJuridico">
           
            @Html.Partial("_tabJuridico")          
        </div>
        <div id="tabNatural">
            @Html.Partial("_tabNatural")           
        </div>
    </div>*@



    @*<div>
        @Html.ActionLink("Regresar", "Index")
    </div>*@

</div>

<div id="upDetails"></div>



@section scripts{
    <script type="text/javascript">
        function OnSuccessDetails(data) {
            $("#frmDetails").dialog({
                modal: true,
                width: 600,
                buttons: {
                    'Cerrar': function () {
                        $(this).dialog('close');
                    }
                },
                close: function () {
                    $(this).parent().remove();
                    $(this).remove();
                }
            });
        }


        $(document).ready(function () {
            $("#tabs").tabs();
        });
    </script>
}
